.class public Lcom/adview/AdViewManager;
.super Ljava/lang/Object;
.source "AdViewManager.java"


# static fields
.field private static final PREFS_STRING_CONFIG:Ljava/lang/String; = "config"

.field private static final PREFS_STRING_TIMESTAMP:Ljava/lang/String; = "timestamp"

.field public static configExpireTimeout:I


# instance fields
.field public bGetConfig:Z

.field public bLocationForeign:Z

.field private contextReference:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference",
            "<",
            "Landroid/content/Context;",
            ">;"
        }
    .end annotation
.end field

.field private extra:Lcom/adview/obj/Extra;

.field public keyAdView:Ljava/lang/String;

.field public mLocation:Ljava/lang/String;

.field public mSimulator:I

.field private needFetchEveryTime:Z

.field private rationsList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/adview/obj/Ration;",
            ">;"
        }
    .end annotation
.end field

.field rollover_pri:Ljava/util/Iterator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Iterator",
            "<",
            "Lcom/adview/obj/Ration;",
            ">;"
        }
    .end annotation
.end field

.field rollovers:Ljava/util/Iterator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Iterator",
            "<",
            "Lcom/adview/obj/Ration;",
            ">;"
        }
    .end annotation
.end field

.field private totalWeight:D

.field private youmiInit:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 45
    const/16 v0, 0x708

    sput v0, Lcom/adview/AdViewManager;->configExpireTimeout:I

    .line 35
    return-void
.end method

.method public constructor <init>(Ljava/lang/ref/WeakReference;Ljava/lang/String;)V
    .locals 4
    .parameter
    .parameter "keyAdView"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/ref/WeakReference",
            "<",
            "Landroid/content/Context;",
            ">;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .local p1, contextReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/content/Context;>;"
    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 61
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 41
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/adview/AdViewManager;->totalWeight:D

    .line 46
    iput-boolean v2, p0, Lcom/adview/AdViewManager;->needFetchEveryTime:Z

    .line 51
    iput v2, p0, Lcom/adview/AdViewManager;->mSimulator:I

    .line 55
    iput-boolean v3, p0, Lcom/adview/AdViewManager;->youmiInit:Z

    .line 56
    iput-boolean v2, p0, Lcom/adview/AdViewManager;->bGetConfig:Z

    .line 58
    iput-boolean v2, p0, Lcom/adview/AdViewManager;->bLocationForeign:Z

    .line 59
    const-string v0, ""

    iput-object v0, p0, Lcom/adview/AdViewManager;->mLocation:Ljava/lang/String;

    .line 62
    const-string v0, "Android"

    const-string v1, "Creating weivda reganam..."

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 63
    iput-object p1, p0, Lcom/adview/AdViewManager;->contextReference:Ljava/lang/ref/WeakReference;

    .line 64
    iput-object p2, p0, Lcom/adview/AdViewManager;->keyAdView:Ljava/lang/String;

    .line 66
    invoke-static {}, Lcom/adview/AdViewTargeting;->getUpdateMode()Lcom/adview/AdViewTargeting$UpdateMode;

    move-result-object v0

    sget-object v1, Lcom/adview/AdViewTargeting$UpdateMode;->DEFAULT:Lcom/adview/AdViewTargeting$UpdateMode;

    if-ne v0, v1, :cond_1

    .line 67
    iput-boolean v2, p0, Lcom/adview/AdViewManager;->needFetchEveryTime:Z

    .line 76
    :cond_0
    :goto_0
    invoke-direct {p0}, Lcom/adview/AdViewManager;->isSimulator()I

    move-result v0

    iput v0, p0, Lcom/adview/AdViewManager;->mSimulator:I

    .line 78
    invoke-virtual {p0}, Lcom/adview/AdViewManager;->isLocateForeign()Z

    move-result v0

    iput-boolean v0, p0, Lcom/adview/AdViewManager;->bLocationForeign:Z

    .line 79
    iget-boolean v0, p0, Lcom/adview/AdViewManager;->bLocationForeign:Z

    if-nez v0, :cond_2

    .line 80
    const-string v0, "china"

    iput-object v0, p0, Lcom/adview/AdViewManager;->mLocation:Ljava/lang/String;

    .line 83
    :goto_1
    return-void

    .line 69
    :cond_1
    invoke-static {}, Lcom/adview/AdViewTargeting;->getUpdateMode()Lcom/adview/AdViewTargeting$UpdateMode;

    move-result-object v0

    sget-object v1, Lcom/adview/AdViewTargeting$UpdateMode;->EVERYTIME:Lcom/adview/AdViewTargeting$UpdateMode;

    if-ne v0, v1, :cond_0

    .line 70
    iput-boolean v3, p0, Lcom/adview/AdViewManager;->needFetchEveryTime:Z

    goto :goto_0

    .line 82
    :cond_2
    const-string v0, "foreign"

    iput-object v0, p0, Lcom/adview/AdViewManager;->mLocation:Ljava/lang/String;

    goto :goto_1
.end method

.method private checkConfigurationString(Ljava/lang/String;)Z
    .locals 6
    .parameter "jsonString"

    .prologue
    .line 348
    const/4 v2, 0x0

    .line 350
    .local v2, ret:Z
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v3

    sget-object v4, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v3, v4, :cond_0

    .line 354
    :cond_0
    :try_start_0
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 355
    .local v1, json:Lorg/json/JSONObject;
    const-string v3, "extra"

    invoke-virtual {v1, v3}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_1

    const-string v3, "rations"

    invoke-virtual {v1, v3}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_1

    move-result v3

    if-eqz v3, :cond_1

    .line 356
    const/4 v2, 0x1

    .line 371
    .end local v1           #json:Lorg/json/JSONObject;
    :cond_1
    :goto_0
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v3

    sget-object v4, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v3, v4, :cond_2

    .line 372
    const-string v3, "AdView SDK v1.7.0"

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "ret="

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 374
    :cond_2
    return v2

    .line 358
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 359
    .local v0, e:Lorg/json/JSONException;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v3

    sget-object v4, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v3, v4, :cond_3

    .line 360
    const-string v3, "AdView SDK v1.7.0"

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 362
    :cond_3
    const/4 v2, 0x0

    goto :goto_0

    .line 364
    .end local v0           #e:Lorg/json/JSONException;
    :catch_1
    move-exception v3

    move-object v0, v3

    .line 365
    .local v0, e:Ljava/lang/NullPointerException;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v3

    sget-object v4, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v3, v4, :cond_4

    .line 366
    const-string v3, "AdView SDK v1.7.0"

    invoke-virtual {v0}, Ljava/lang/NullPointerException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 368
    :cond_4
    const/4 v2, 0x0

    goto :goto_0
.end method

.method private convertStreamToString(Ljava/io/InputStream;)Ljava/lang/String;
    .locals 7
    .parameter "is"

    .prologue
    const/4 v6, 0x0

    .line 322
    new-instance v2, Ljava/io/BufferedReader;

    new-instance v4, Ljava/io/InputStreamReader;

    invoke-direct {v4, p1}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V

    const/16 v5, 0x2000

    invoke-direct {v2, v4, v5}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;I)V

    .line 323
    .local v2, reader:Ljava/io/BufferedReader;
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    .line 325
    .local v3, sb:Ljava/lang/StringBuilder;
    const/4 v1, 0x0

    .line 327
    .local v1, line:Ljava/lang/String;
    :goto_0
    :try_start_0
    invoke-virtual {v2}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    if-nez v1, :cond_0

    .line 337
    :try_start_1
    invoke-virtual {p1}, Ljava/io/InputStream;->close()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_3

    .line 344
    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    :goto_1
    return-object v4

    .line 328
    :cond_0
    :try_start_2
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, "\n"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    .line 331
    :catch_0
    move-exception v4

    move-object v0, v4

    .line 337
    .local v0, e:Ljava/io/IOException;
    :try_start_3
    invoke-virtual {p1}, Ljava/io/InputStream;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1

    move-object v4, v6

    .line 333
    goto :goto_1

    .line 338
    :catch_1
    move-exception v0

    move-object v4, v6

    .line 340
    goto :goto_1

    .line 335
    .end local v0           #e:Ljava/io/IOException;
    :catchall_0
    move-exception v4

    .line 337
    :try_start_4
    invoke-virtual {p1}, Ljava/io/InputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_2

    .line 342
    throw v4

    .line 338
    :catch_2
    move-exception v0

    .restart local v0       #e:Ljava/io/IOException;
    move-object v4, v6

    .line 340
    goto :goto_1

    .line 338
    .end local v0           #e:Ljava/io/IOException;
    :catch_3
    move-exception v0

    .restart local v0       #e:Ljava/io/IOException;
    move-object v4, v6

    .line 340
    goto :goto_1
.end method

.method private getLocalConfig(Ljava/lang/String;)Ljava/lang/String;
    .locals 8
    .parameter "sdkkey"

    .prologue
    const/4 v7, 0x0

    .line 183
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v5

    if-nez v5, :cond_1

    :cond_0
    move-object v5, v7

    .line 207
    :goto_0
    return-object v5

    .line 188
    :cond_1
    iget-object v5, p0, Lcom/adview/AdViewManager;->contextReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v5}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/Context;

    .line 190
    .local v0, context:Landroid/content/Context;
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, ".txt"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 191
    .local v2, filename:Ljava/lang/String;
    const/4 v4, 0x0

    .line 194
    .local v4, localconfig:Ljava/lang/String;
    :try_start_0
    invoke-virtual {v0}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v5

    invoke-virtual {v5, v2}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v3

    .line 195
    .local v3, is:Ljava/io/InputStream;
    invoke-direct {p0, v3}, Lcom/adview/AdViewManager;->convertStreamToString(Ljava/io/InputStream;)Ljava/lang/String;

    move-result-object v4

    .line 196
    invoke-virtual {v3}, Ljava/io/InputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 204
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v5

    sget-object v6, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v5, v6, :cond_2

    .line 205
    const-string v5, "AdView SDK v1.7.0"

    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "localconfig="

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    :cond_2
    move-object v5, v4

    .line 207
    goto :goto_0

    .line 197
    .end local v3           #is:Ljava/io/InputStream;
    :catch_0
    move-exception v5

    move-object v1, v5

    .line 198
    .local v1, e:Ljava/lang/Exception;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v5

    sget-object v6, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v5, v6, :cond_3

    .line 199
    const-string v5, "AdView SDK v1.7.0"

    invoke-virtual {v1}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    :cond_3
    move-object v5, v7

    .line 201
    goto :goto_0
.end method

.method private isSimulator()I
    .locals 7

    .prologue
    .line 658
    iget-object v4, p0, Lcom/adview/AdViewManager;->contextReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v4}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/Context;

    .line 659
    .local v0, context:Landroid/content/Context;
    if-nez v0, :cond_0

    .line 660
    const/4 v4, 0x0

    .line 677
    :goto_0
    return v4

    .line 663
    :cond_0
    const-string v4, "phone"

    invoke-virtual {v0, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/telephony/TelephonyManager;

    .line 666
    .local v3, tm:Landroid/telephony/TelephonyManager;
    invoke-virtual {v3}, Landroid/telephony/TelephonyManager;->getDeviceId()Ljava/lang/String;

    move-result-object v1

    .line 667
    .local v1, imei:Ljava/lang/String;
    if-eqz v1, :cond_1

    const-string v4, "000000000000000"

    invoke-virtual {v1, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 668
    :cond_1
    const/4 v2, 0x1

    .line 674
    .local v2, ret:I
    :goto_1
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v4

    sget-object v5, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v4, v5, :cond_2

    .line 675
    const-string v4, "AdView SDK v1.7.0"

    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "isSimulator, ret="

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    :cond_2
    move v4, v2

    .line 677
    goto :goto_0

    .line 671
    .end local v2           #ret:I
    :cond_3
    const/4 v2, 0x0

    .restart local v2       #ret:I
    goto :goto_1
.end method

.method private parseConfigurationString(Ljava/lang/String;)V
    .locals 5
    .parameter "jsonString"

    .prologue
    .line 379
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v2

    sget-object v3, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v2, v3, :cond_0

    .line 380
    const-string v2, "AdView SDK v1.7.0"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Received jsonString: "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 383
    :cond_0
    :try_start_0
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 385
    .local v1, json:Lorg/json/JSONObject;
    const-string v2, "extra"

    invoke-virtual {v1, v2}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v2

    invoke-direct {p0, v2}, Lcom/adview/AdViewManager;->parseExtraJson(Lorg/json/JSONObject;)V

    .line 386
    const-string v2, "rations"

    invoke-virtual {v1, v2}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v2

    invoke-direct {p0, v2}, Lcom/adview/AdViewManager;->parseRationsJson(Lorg/json/JSONArray;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_1

    .line 396
    .end local v1           #json:Lorg/json/JSONObject;
    :goto_0
    return-void

    .line 388
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 390
    .local v0, e:Lorg/json/JSONException;
    new-instance v2, Lcom/adview/obj/Extra;

    invoke-direct {v2}, Lcom/adview/obj/Extra;-><init>()V

    iput-object v2, p0, Lcom/adview/AdViewManager;->extra:Lcom/adview/obj/Extra;

    goto :goto_0

    .line 392
    .end local v0           #e:Lorg/json/JSONException;
    :catch_1
    move-exception v2

    move-object v0, v2

    .line 394
    .local v0, e:Ljava/lang/NullPointerException;
    new-instance v2, Lcom/adview/obj/Extra;

    invoke-direct {v2}, Lcom/adview/obj/Extra;-><init>()V

    iput-object v2, p0, Lcom/adview/AdViewManager;->extra:Lcom/adview/obj/Extra;

    goto :goto_0
.end method

.method private parseExtraJson(Lorg/json/JSONObject;)V
    .locals 5
    .parameter "json"

    .prologue
    .line 442
    new-instance v1, Lcom/adview/obj/Extra;

    invoke-direct {v1}, Lcom/adview/obj/Extra;-><init>()V

    .line 445
    .local v1, extra:Lcom/adview/obj/Extra;
    :try_start_0
    const-string v3, "cycle_time"

    invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->cycleTime:I

    .line 446
    const-string v3, "loacation_on"

    invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->locationOn:I

    .line 447
    const-string v3, "transition"

    invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->transition:I

    .line 448
    const-string v3, "report"

    invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v1, Lcom/adview/obj/Extra;->report:Ljava/lang/String;

    .line 449
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "http://"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, v1, Lcom/adview/obj/Extra;->report:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "/agent/agent2.php?appid=%s&nid=%s&type=%d&uuid=%s&country_code=%s&appver=%d&client=0&simulator=%d"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    sput-object v3, Lcom/adview/util/AdViewUtil;->urlImpression:Ljava/lang/String;

    .line 450
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "http://"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, v1, Lcom/adview/obj/Extra;->report:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "/agent/agent3.php?appid=%s&nid=%s&type=%d&uuid=%s&country_code=%s&appver=%d&client=0&simulator=%d"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    sput-object v3, Lcom/adview/util/AdViewUtil;->urlClick:Ljava/lang/String;

    .line 451
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "http://"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v4, v1, Lcom/adview/obj/Extra;->report:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "/agent/appReport.php?keyAdView=%s&keyDev=%s&typeDev=%s&osVer=%s&resolution=%s&servicePro=%s&netType=%s&channel=%s&platform=%s"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    sput-object v3, Lcom/adview/util/AdViewUtil;->appReport:Ljava/lang/String;

    .line 453
    const-string v3, "background_color_rgb"

    invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    .line 454
    .local v0, backgroundColor:Lorg/json/JSONObject;
    const-string v3, "red"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->bgRed:I

    .line 455
    const-string v3, "green"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->bgGreen:I

    .line 456
    const-string v3, "blue"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->bgBlue:I

    .line 457
    const-string v3, "alpha"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    mul-int/lit16 v3, v3, 0xff

    iput v3, v1, Lcom/adview/obj/Extra;->bgAlpha:I

    .line 459
    const-string v3, "text_color_rgb"

    invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v2

    .line 460
    .local v2, textColor:Lorg/json/JSONObject;
    const-string v3, "red"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->fgRed:I

    .line 461
    const-string v3, "green"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->fgGreen:I

    .line 462
    const-string v3, "blue"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    iput v3, v1, Lcom/adview/obj/Extra;->fgBlue:I

    .line 463
    const-string v3, "alpha"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v3

    mul-int/lit16 v3, v3, 0xff

    iput v3, v1, Lcom/adview/obj/Extra;->fgAlpha:I
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 469
    .end local v0           #backgroundColor:Lorg/json/JSONObject;
    .end local v2           #textColor:Lorg/json/JSONObject;
    :goto_0
    iput-object v1, p0, Lcom/adview/AdViewManager;->extra:Lcom/adview/obj/Extra;

    .line 470
    return-void

    .line 466
    :catch_0
    move-exception v3

    goto :goto_0
.end method

.method private parseOfflineConfigurationString(Ljava/lang/String;)V
    .locals 6
    .parameter "jsonString"

    .prologue
    .line 399
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v3

    sget-object v4, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v3, v4, :cond_0

    .line 400
    const-string v3, "AdView SDK v1.7.0"

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "Received jsonString: "

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 403
    :cond_0
    :try_start_0
    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 405
    .local v2, json:Lorg/json/JSONObject;
    iget-boolean v3, p0, Lcom/adview/AdViewManager;->bLocationForeign:Z

    if-nez v3, :cond_1

    .line 407
    const-string v3, "china_cfg"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v2

    .line 414
    :goto_0
    const-string v3, "extra"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v3

    invoke-direct {p0, v3}, Lcom/adview/AdViewManager;->parseExtraJson(Lorg/json/JSONObject;)V

    .line 415
    const-string v3, "rations"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    invoke-direct {p0, v3}, Lcom/adview/AdViewManager;->parseRationsJson(Lorg/json/JSONArray;)V

    .line 439
    .end local v2           #json:Lorg/json/JSONObject;
    :goto_1
    return-void

    .line 411
    .restart local v2       #json:Lorg/json/JSONObject;
    :cond_1
    const-string v3, "foreign_cfg"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_3

    move-result-object v2

    goto :goto_0

    .line 417
    .end local v2           #json:Lorg/json/JSONObject;
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 421
    .local v0, e:Lorg/json/JSONException;
    :try_start_1
    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 423
    .restart local v2       #json:Lorg/json/JSONObject;
    const-string v3, "extra"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v3

    invoke-direct {p0, v3}, Lcom/adview/AdViewManager;->parseExtraJson(Lorg/json/JSONObject;)V

    .line 424
    const-string v3, "rations"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    invoke-direct {p0, v3}, Lcom/adview/AdViewManager;->parseRationsJson(Lorg/json/JSONArray;)V
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/NullPointerException; {:try_start_1 .. :try_end_1} :catch_2

    goto :goto_1

    .line 426
    .end local v2           #json:Lorg/json/JSONObject;
    :catch_1
    move-exception v3

    move-object v1, v3

    .line 428
    .local v1, e2:Lorg/json/JSONException;
    new-instance v3, Lcom/adview/obj/Extra;

    invoke-direct {v3}, Lcom/adview/obj/Extra;-><init>()V

    iput-object v3, p0, Lcom/adview/AdViewManager;->extra:Lcom/adview/obj/Extra;

    goto :goto_1

    .line 430
    .end local v1           #e2:Lorg/json/JSONException;
    :catch_2
    move-exception v3

    move-object v1, v3

    .line 432
    .local v1, e2:Ljava/lang/NullPointerException;
    new-instance v3, Lcom/adview/obj/Extra;

    invoke-direct {v3}, Lcom/adview/obj/Extra;-><init>()V

    iput-object v3, p0, Lcom/adview/AdViewManager;->extra:Lcom/adview/obj/Extra;

    goto :goto_1

    .line 435
    .end local v0           #e:Lorg/json/JSONException;
    .end local v1           #e2:Ljava/lang/NullPointerException;
    :catch_3
    move-exception v3

    move-object v0, v3

    .line 437
    .local v0, e:Ljava/lang/NullPointerException;
    new-instance v3, Lcom/adview/obj/Extra;

    invoke-direct {v3}, Lcom/adview/obj/Extra;-><init>()V

    iput-object v3, p0, Lcom/adview/AdViewManager;->extra:Lcom/adview/obj/Extra;

    goto :goto_1
.end method

.method private parseRationsJson(Lorg/json/JSONArray;)V
    .locals 11
    .parameter "json"

    .prologue
    .line 473
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    .line 475
    .local v3, rationsList:Ljava/util/List;,"Ljava/util/List<Lcom/adview/obj/Ration;>;"
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 477
    .local v4, rationsList_ex:Ljava/util/List;,"Ljava/util/List<Lcom/adview/obj/Ration;>;"
    const-wide/16 v5, 0x0

    .line 478
    .local v5, totalweight:D
    const-wide/16 v7, 0x0

    .line 485
    .local v7, totalweight_ex:D
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    :try_start_0
    invoke-virtual {p1}, Lorg/json/JSONArray;->length()I
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v9

    if-lt v0, v9, :cond_0

    .line 554
    :goto_1
    invoke-interface {v3, v4}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    .line 555
    add-double/2addr v5, v7

    .line 559
    invoke-static {v3}, Ljava/util/Collections;->sort(Ljava/util/List;)V

    .line 560
    iput-object v3, p0, Lcom/adview/AdViewManager;->rationsList:Ljava/util/List;

    .line 561
    iget-object v9, p0, Lcom/adview/AdViewManager;->rationsList:Ljava/util/List;

    invoke-interface {v9}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v9

    iput-object v9, p0, Lcom/adview/AdViewManager;->rollovers:Ljava/util/Iterator;

    .line 562
    iput-wide v5, p0, Lcom/adview/AdViewManager;->totalWeight:D

    .line 569
    return-void

    .line 486
    :cond_0
    :try_start_1
    invoke-virtual {p1, v0}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v1

    .line 487
    .local v1, jsonRation:Lorg/json/JSONObject;
    if-nez v1, :cond_1

    .line 485
    :goto_2
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 491
    :cond_1
    new-instance v2, Lcom/adview/obj/Ration;

    invoke-direct {v2}, Lcom/adview/obj/Ration;-><init>()V

    .line 493
    .local v2, ration:Lcom/adview/obj/Ration;
    const-string v9, "nid"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->nid:Ljava/lang/String;

    .line 494
    const-string v9, "type"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v9

    iput v9, v2, Lcom/adview/obj/Ration;->type:I

    .line 495
    const-string v9, "nname"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->name:Ljava/lang/String;

    .line 496
    const-string v9, "weight"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v9

    int-to-double v9, v9

    iput-wide v9, v2, Lcom/adview/obj/Ration;->weight:D

    .line 497
    const-string v9, "priority"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v9

    iput v9, v2, Lcom/adview/obj/Ration;->priority:I

    .line 500
    iget v9, v2, Lcom/adview/obj/Ration;->type:I

    sparse-switch v9, :sswitch_data_0

    .line 522
    :goto_3
    const-string v9, "key"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    .line 526
    :goto_4
    invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 527
    iget-wide v9, v2, Lcom/adview/obj/Ration;->weight:D

    add-double/2addr v5, v9

    goto :goto_2

    .line 509
    :sswitch_0
    const-string v9, "key"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    .line 510
    const-string v9, "key2"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->key2:Ljava/lang/String;

    goto :goto_4

    .line 530
    .end local v1           #jsonRation:Lorg/json/JSONObject;
    .end local v2           #ration:Lcom/adview/obj/Ration;
    :catch_0
    move-exception v9

    goto :goto_1

    .line 514
    .restart local v1       #jsonRation:Lorg/json/JSONObject;
    .restart local v2       #ration:Lcom/adview/obj/Ration;
    :sswitch_1
    const-string v9, "key"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    .line 515
    const-string v9, "key2"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->key2:Ljava/lang/String;

    .line 516
    const-string v9, "type2"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v9

    iput v9, v2, Lcom/adview/obj/Ration;->type2:I

    .line 517
    const-string v9, "logo"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->logo:Ljava/lang/String;

    goto :goto_4

    .line 520
    :sswitch_2
    const-string v9, "key3"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    iput-object v9, v2, Lcom/adview/obj/Ration;->key3:Ljava/lang/String;
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_3

    .line 500
    nop

    :sswitch_data_0
    .sparse-switch
        0x7 -> :sswitch_0
        0x16 -> :sswitch_0
        0x1c -> :sswitch_1
        0x1d -> :sswitch_0
        0x23 -> :sswitch_0
        0x26 -> :sswitch_2
        0x2b -> :sswitch_0
        0x30 -> :sswitch_0
        0x31 -> :sswitch_0
        0x3e7 -> :sswitch_0
    .end sparse-switch
.end method


# virtual methods
.method public fetchConfig()V
    .locals 20

    .prologue
    .line 211
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/adview/AdViewManager;->contextReference:Ljava/lang/ref/WeakReference;

    move-object/from16 v16, v0

    invoke-virtual/range {v16 .. v16}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Landroid/content/Context;

    .line 214
    .local v5, context:Landroid/content/Context;
    if-nez v5, :cond_0

    .line 277
    :goto_0
    return-void

    .line 218
    :cond_0
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/adview/AdViewManager;->keyAdView:Ljava/lang/String;

    move-object/from16 v16, v0

    const/16 v17, 0x0

    move-object v0, v5

    move-object/from16 v1, v16

    move/from16 v2, v17

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v4

    .line 219
    .local v4, adViewPrefs:Landroid/content/SharedPreferences;
    const-string v16, "config"

    const/16 v17, 0x0

    move-object v0, v4

    move-object/from16 v1, v16

    move-object/from16 v2, v17

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v13

    .line 221
    .local v13, jsonString:Ljava/lang/String;
    if-eqz v13, :cond_1

    move-object/from16 v0, p0

    iget-boolean v0, v0, Lcom/adview/AdViewManager;->needFetchEveryTime:Z

    move/from16 v16, v0

    if-eqz v16, :cond_4

    .line 223
    :cond_1
    new-instance v9, Lorg/apache/http/impl/client/DefaultHttpClient;

    invoke-direct {v9}, Lorg/apache/http/impl/client/DefaultHttpClient;-><init>()V

    .line 224
    .local v9, httpClient:Lorg/apache/http/client/HttpClient;
    const-string v16, "http://www.adview.cn/agent/agent1_android.php?appid=%s&appver=%d&client=0&simulator=%d&location=%s"

    const/16 v17, 0x4

    move/from16 v0, v17

    new-array v0, v0, [Ljava/lang/Object;

    move-object/from16 v17, v0

    const/16 v18, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/adview/AdViewManager;->keyAdView:Ljava/lang/String;

    move-object/from16 v19, v0

    aput-object v19, v17, v18

    const/16 v18, 0x1

    const/16 v19, 0xaa

    invoke-static/range {v19 .. v19}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v19

    aput-object v19, v17, v18

    const/16 v18, 0x2

    move-object/from16 v0, p0

    iget v0, v0, Lcom/adview/AdViewManager;->mSimulator:I

    move/from16 v19, v0

    invoke-static/range {v19 .. v19}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v19

    aput-object v19, v17, v18

    const/16 v18, 0x3

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/adview/AdViewManager;->mLocation:Ljava/lang/String;

    move-object/from16 v19, v0

    aput-object v19, v17, v18

    invoke-static/range {v16 .. v17}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v15

    .line 225
    .local v15, url:Ljava/lang/String;
    new-instance v10, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v10, v15}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 228
    .local v10, httpGet:Lorg/apache/http/client/methods/HttpGet;
    :try_start_0
    invoke-interface {v9, v10}, Lorg/apache/http/client/HttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v11

    .line 230
    .local v11, httpResponse:Lorg/apache/http/HttpResponse;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v16

    sget-object v17, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    move-object/from16 v0, v16

    move-object/from16 v1, v17

    if-ne v0, v1, :cond_2

    .line 233
    :cond_2
    invoke-interface {v11}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v16

    invoke-interface/range {v16 .. v16}, Lorg/apache/http/StatusLine;->getStatusCode()I

    move-result v16

    const/16 v17, 0xc8

    move/from16 v0, v16

    move/from16 v1, v17

    if-ne v0, v1, :cond_3

    .line 234
    invoke-interface {v11}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v8

    .line 236
    .local v8, entity:Lorg/apache/http/HttpEntity;
    if-eqz v8, :cond_3

    .line 237
    invoke-interface {v8}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v12

    .line 238
    .local v12, inputStream:Ljava/io/InputStream;
    const-string v14, ""

    .line 239
    .local v14, jsonStringHttp:Ljava/lang/String;
    move-object/from16 v0, p0

    move-object v1, v12

    invoke-direct {v0, v1}, Lcom/adview/AdViewManager;->convertStreamToString(Ljava/io/InputStream;)Ljava/lang/String;

    move-result-object v14

    .line 240
    invoke-virtual {v14}, Ljava/lang/String;->length()I

    move-result v16

    if-lez v16, :cond_3

    .line 241
    move-object/from16 v0, p0

    move-object v1, v14

    invoke-direct {v0, v1}, Lcom/adview/AdViewManager;->checkConfigurationString(Ljava/lang/String;)Z

    move-result v16

    if-eqz v16, :cond_3

    .line 243
    move-object v13, v14

    .line 244
    invoke-interface {v4}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v7

    .line 245
    .local v7, editor:Landroid/content/SharedPreferences$Editor;
    const-string v16, "config"

    move-object v0, v7

    move-object/from16 v1, v16

    move-object v2, v13

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 246
    const-string v16, "timestamp"

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v17

    move-object v0, v7

    move-object/from16 v1, v16

    move-wide/from16 v2, v17

    invoke-interface {v0, v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    .line 247
    invoke-interface {v7}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 248
    const/16 v16, 0x1

    move/from16 v0, v16

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lcom/adview/AdViewManager;->bGetConfig:Z
    :try_end_0
    .catch Lorg/apache/http/client/ClientProtocolException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    .line 263
    .end local v7           #editor:Landroid/content/SharedPreferences$Editor;
    .end local v8           #entity:Lorg/apache/http/HttpEntity;
    .end local v11           #httpResponse:Lorg/apache/http/HttpResponse;
    .end local v12           #inputStream:Ljava/io/InputStream;
    .end local v14           #jsonStringHttp:Ljava/lang/String;
    :cond_3
    :goto_1
    invoke-interface {v9}, Lorg/apache/http/client/HttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v16

    invoke-interface/range {v16 .. v16}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    .line 265
    if-nez v13, :cond_4

    .line 267
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/adview/AdViewManager;->keyAdView:Ljava/lang/String;

    move-object/from16 v16, v0

    move-object/from16 v0, p0

    move-object/from16 v1, v16

    invoke-direct {v0, v1}, Lcom/adview/AdViewManager;->getLocalConfig(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v13

    .line 268
    move-object/from16 v0, p0

    move-object v1, v13

    invoke-direct {v0, v1}, Lcom/adview/AdViewManager;->parseOfflineConfigurationString(Ljava/lang/String;)V

    goto/16 :goto_0

    .line 255
    :catch_0
    move-exception v16

    move-object/from16 v6, v16

    .line 256
    .local v6, e:Lorg/apache/http/client/ClientProtocolException;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v16

    sget-object v17, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    move-object/from16 v0, v16

    move-object/from16 v1, v17

    if-ne v0, v1, :cond_3

    .line 257
    const-string v16, "AdView SDK v1.7.0"

    invoke-virtual {v6}, Lorg/apache/http/client/ClientProtocolException;->toString()Ljava/lang/String;

    move-result-object v17

    invoke-static/range {v16 .. v17}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1

    .line 258
    .end local v6           #e:Lorg/apache/http/client/ClientProtocolException;
    :catch_1
    move-exception v16

    move-object/from16 v6, v16

    .line 259
    .local v6, e:Ljava/io/IOException;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v16

    sget-object v17, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    move-object/from16 v0, v16

    move-object/from16 v1, v17

    if-ne v0, v1, :cond_3

    .line 260
    const-string v16, "AdView SDK v1.7.0"

    invoke-virtual {v6}, Ljava/io/IOException;->toString()Ljava/lang/String;

    move-result-object v17

    invoke-static/range {v16 .. v17}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1

    .line 276
    .end local v6           #e:Ljava/io/IOException;
    .end local v9           #httpClient:Lorg/apache/http/client/HttpClient;
    .end local v10           #httpGet:Lorg/apache/http/client/methods/HttpGet;
    .end local v15           #url:Ljava/lang/String;
    :cond_4
    move-object/from16 v0, p0

    move-object v1, v13

    invoke-direct {v0, v1}, Lcom/adview/AdViewManager;->parseConfigurationString(Ljava/lang/String;)V

    goto/16 :goto_0
.end method

.method public fetchConfigFromServer()V
    .locals 15

    .prologue
    const/4 v14, 0x0

    .line 280
    iget-object v11, p0, Lcom/adview/AdViewManager;->contextReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v11}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/content/Context;

    .line 281
    .local v1, context:Landroid/content/Context;
    iget-object v11, p0, Lcom/adview/AdViewManager;->keyAdView:Ljava/lang/String;

    invoke-virtual {v1, v11, v14}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 282
    .local v0, adViewPrefs:Landroid/content/SharedPreferences;
    const-string v9, ""

    .line 283
    .local v9, jsonString:Ljava/lang/String;
    new-instance v5, Lorg/apache/http/impl/client/DefaultHttpClient;

    invoke-direct {v5}, Lorg/apache/http/impl/client/DefaultHttpClient;-><init>()V

    .line 285
    .local v5, httpClient:Lorg/apache/http/client/HttpClient;
    const-string v11, "http://www.adview.cn/agent/agent1_android.php?appid=%s&appver=%d&client=0&simulator=%d&location=%s"

    const/4 v12, 0x4

    new-array v12, v12, [Ljava/lang/Object;

    iget-object v13, p0, Lcom/adview/AdViewManager;->keyAdView:Ljava/lang/String;

    aput-object v13, v12, v14

    const/4 v13, 0x1

    const/16 v14, 0xaa

    invoke-static {v14}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v14

    aput-object v14, v12, v13

    const/4 v13, 0x2

    iget v14, p0, Lcom/adview/AdViewManager;->mSimulator:I

    invoke-static {v14}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v14

    aput-object v14, v12, v13

    const/4 v13, 0x3

    iget-object v14, p0, Lcom/adview/AdViewManager;->mLocation:Ljava/lang/String;

    aput-object v14, v12, v13

    invoke-static {v11, v12}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v10

    .line 286
    .local v10, url:Ljava/lang/String;
    new-instance v6, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v6, v10}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 290
    .local v6, httpGet:Lorg/apache/http/client/methods/HttpGet;
    :try_start_0
    invoke-interface {v5, v6}, Lorg/apache/http/client/HttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v7

    .line 293
    .local v7, httpResponse:Lorg/apache/http/HttpResponse;
    invoke-interface {v7}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v11

    invoke-interface {v11}, Lorg/apache/http/StatusLine;->getStatusCode()I

    move-result v11

    const/16 v12, 0xc8

    if-ne v11, v12, :cond_0

    .line 294
    invoke-interface {v7}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v4

    .line 296
    .local v4, entity:Lorg/apache/http/HttpEntity;
    if-eqz v4, :cond_0

    .line 297
    invoke-interface {v4}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v8

    .line 298
    .local v8, inputStream:Ljava/io/InputStream;
    invoke-direct {p0, v8}, Lcom/adview/AdViewManager;->convertStreamToString(Ljava/io/InputStream;)Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Lorg/apache/http/client/ClientProtocolException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v9

    .line 308
    .end local v4           #entity:Lorg/apache/http/HttpEntity;
    .end local v8           #inputStream:Ljava/io/InputStream;
    :cond_0
    invoke-interface {v5}, Lorg/apache/http/client/HttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v11

    invoke-interface {v11}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    .line 310
    .end local v7           #httpResponse:Lorg/apache/http/HttpResponse;
    :goto_0
    invoke-virtual {v9}, Ljava/lang/String;->length()I

    move-result v11

    if-lez v11, :cond_1

    invoke-direct {p0, v9}, Lcom/adview/AdViewManager;->checkConfigurationString(Ljava/lang/String;)Z

    move-result v11

    if-eqz v11, :cond_1

    .line 314
    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v3

    .line 315
    .local v3, editor:Landroid/content/SharedPreferences$Editor;
    const-string v11, "config"

    invoke-interface {v3, v11, v9}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 316
    invoke-interface {v3}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 319
    .end local v3           #editor:Landroid/content/SharedPreferences$Editor;
    :cond_1
    return-void

    .line 301
    :catch_0
    move-exception v11

    move-object v2, v11

    .line 302
    .local v2, e:Lorg/apache/http/client/ClientProtocolException;
    :try_start_1
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v11

    sget-object v12, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v11, v12, :cond_2

    .line 303
    const-string v11, "AdView SDK v1.7.0"

    invoke-virtual {v2}, Lorg/apache/http/client/ClientProtocolException;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 308
    :cond_2
    invoke-interface {v5}, Lorg/apache/http/client/HttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v11

    invoke-interface {v11}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    goto :goto_0

    .line 304
    .end local v2           #e:Lorg/apache/http/client/ClientProtocolException;
    :catch_1
    move-exception v11

    move-object v2, v11

    .line 305
    .local v2, e:Ljava/io/IOException;
    :try_start_2
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v11

    sget-object v12, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v11, v12, :cond_3

    .line 306
    const-string v11, "AdView SDK v1.7.0"

    invoke-virtual {v2}, Ljava/io/IOException;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-static {v11, v12}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 308
    :cond_3
    invoke-interface {v5}, Lorg/apache/http/client/HttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v11

    invoke-interface {v11}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    goto :goto_0

    .line 307
    .end local v2           #e:Ljava/io/IOException;
    :catchall_0
    move-exception v11

    .line 308
    invoke-interface {v5}, Lorg/apache/http/client/HttpClient;->getConnectionManager()Lorg/apache/http/conn/ClientConnectionManager;

    move-result-object v12

    invoke-interface {v12}, Lorg/apache/http/conn/ClientConnectionManager;->shutdown()V

    .line 309
    throw v11
.end method

.method public getConfigExpiereTimeout()I
    .locals 1

    .prologue
    .line 109
    sget v0, Lcom/adview/AdViewManager;->configExpireTimeout:I

    return v0
.end method

.method public getExtra()Lcom/adview/obj/Extra;
    .locals 4

    .prologue
    .line 99
    iget-wide v0, p0, Lcom/adview/AdViewManager;->totalWeight:D

    const-wide/16 v2, 0x0

    cmpg-double v0, v0, v2

    if-gtz v0, :cond_0

    .line 101
    const/4 v0, 0x0

    .line 104
    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/adview/AdViewManager;->extra:Lcom/adview/obj/Extra;

    goto :goto_0
.end method

.method public getRation()Lcom/adview/obj/Ration;
    .locals 11

    .prologue
    .line 113
    new-instance v3, Ljava/util/Random;

    invoke-direct {v3}, Ljava/util/Random;-><init>()V

    .line 115
    .local v3, random:Ljava/util/Random;
    invoke-virtual {v3}, Ljava/util/Random;->nextDouble()D

    move-result-wide v7

    iget-wide v9, p0, Lcom/adview/AdViewManager;->totalWeight:D

    mul-double v1, v7, v9

    .line 116
    .local v1, r:D
    const-wide/16 v5, 0x0

    .line 119
    .local v5, s:D
    iget-object v7, p0, Lcom/adview/AdViewManager;->rationsList:Ljava/util/List;

    invoke-interface {v7}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .line 120
    .local v0, it:Ljava/util/Iterator;,"Ljava/util/Iterator<Lcom/adview/obj/Ration;>;"
    const/4 v4, 0x0

    .line 121
    .local v4, ration:Lcom/adview/obj/Ration;
    :cond_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-nez v7, :cond_1

    .line 130
    :goto_0
    return-object v4

    .line 122
    :cond_1
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    .end local v4           #ration:Lcom/adview/obj/Ration;
    check-cast v4, Lcom/adview/obj/Ration;

    .line 123
    .restart local v4       #ration:Lcom/adview/obj/Ration;
    iget-wide v7, v4, Lcom/adview/obj/Ration;->weight:D

    add-double/2addr v5, v7

    .line 125
    cmpl-double v7, v5, v1

    if-ltz v7, :cond_0

    goto :goto_0
.end method

.method public getRollover()Lcom/adview/obj/Ration;
    .locals 2

    .prologue
    .line 134
    iget-object v1, p0, Lcom/adview/AdViewManager;->rollovers:Ljava/util/Iterator;

    if-nez v1, :cond_0

    .line 135
    const/4 v1, 0x0

    .line 147
    :goto_0
    return-object v1

    .line 138
    :cond_0
    const/4 v0, 0x0

    .line 139
    .local v0, ration:Lcom/adview/obj/Ration;
    iget-object v1, p0, Lcom/adview/AdViewManager;->rollovers:Ljava/util/Iterator;

    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 140
    iget-object v1, p0, Lcom/adview/AdViewManager;->rollovers:Ljava/util/Iterator;

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #ration:Lcom/adview/obj/Ration;
    check-cast v0, Lcom/adview/obj/Ration;

    .restart local v0       #ration:Lcom/adview/obj/Ration;
    :goto_1
    move-object v1, v0

    .line 147
    goto :goto_0

    .line 144
    :cond_1
    invoke-virtual {p0}, Lcom/adview/AdViewManager;->getRation()Lcom/adview/obj/Ration;

    move-result-object v0

    goto :goto_1
.end method

.method public getRollover_pri()Lcom/adview/obj/Ration;
    .locals 4

    .prologue
    .line 151
    const v0, 0x5f5e100

    .line 152
    .local v0, max:I
    iget-object v3, p0, Lcom/adview/AdViewManager;->rollover_pri:Ljava/util/Iterator;

    if-nez v3, :cond_0

    .line 153
    const/4 v3, 0x0

    .line 170
    :goto_0
    return-object v3

    .line 156
    :cond_0
    const/4 v1, 0x0

    .line 157
    .local v1, ration:Lcom/adview/obj/Ration;
    const/4 v2, 0x0

    .line 158
    .local v2, ration_pri:Lcom/adview/obj/Ration;
    :cond_1
    :goto_1
    iget-object v3, p0, Lcom/adview/AdViewManager;->rollover_pri:Ljava/util/Iterator;

    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_2

    move-object v3, v2

    .line 170
    goto :goto_0

    .line 161
    :cond_2
    iget-object v3, p0, Lcom/adview/AdViewManager;->rollover_pri:Ljava/util/Iterator;

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    .end local v1           #ration:Lcom/adview/obj/Ration;
    check-cast v1, Lcom/adview/obj/Ration;

    .line 162
    .restart local v1       #ration:Lcom/adview/obj/Ration;
    iget v3, v1, Lcom/adview/obj/Ration;->priority:I

    if-ge v3, v0, :cond_1

    .line 164
    move-object v2, v1

    .line 165
    iget v0, v1, Lcom/adview/obj/Ration;->priority:I

    goto :goto_1
.end method

.method public getYoumiInit()Z
    .locals 1

    .prologue
    .line 90
    iget-boolean v0, p0, Lcom/adview/AdViewManager;->youmiInit:Z

    return v0
.end method

.method public isLocateForeign()Z
    .locals 23

    .prologue
    .line 572
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/adview/AdViewManager;->contextReference:Ljava/lang/ref/WeakReference;

    move-object/from16 v20, v0

    invoke-virtual/range {v20 .. v20}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/content/Context;

    .line 573
    .local v3, context:Landroid/content/Context;
    if-nez v3, :cond_0

    .line 574
    const/16 v20, 0x0

    .line 654
    :goto_0
    return v20

    .line 577
    :cond_0
    const-string v20, "phone"

    move-object v0, v3

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v19

    check-cast v19, Landroid/telephony/TelephonyManager;

    .line 579
    .local v19, tm:Landroid/telephony/TelephonyManager;
    invoke-virtual/range {v19 .. v19}, Landroid/telephony/TelephonyManager;->getDeviceId()Ljava/lang/String;

    move-result-object v8

    .line 580
    .local v8, imei:Ljava/lang/String;
    if-eqz v8, :cond_1

    const-string v20, "000000000000000"

    move-object v0, v8

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v20

    if-eqz v20, :cond_3

    .line 581
    :cond_1
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v20

    sget-object v21, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    move-object/from16 v0, v20

    move-object/from16 v1, v21

    if-ne v0, v1, :cond_2

    .line 582
    const-string v20, "AdView SDK v1.7.0"

    const-string v21, "There is no imei, or run in emulator"

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 583
    :cond_2
    const/16 v20, 0x0

    goto :goto_0

    .line 589
    :cond_3
    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v20

    invoke-virtual/range {v20 .. v20}, Ljava/util/Locale;->getCountry()Ljava/lang/String;

    move-result-object v20

    invoke-virtual/range {v20 .. v20}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v4

    .line 590
    .local v4, countryCodeDefault:Ljava/lang/String;
    invoke-virtual/range {v19 .. v19}, Landroid/telephony/TelephonyManager;->getNetworkCountryIso()Ljava/lang/String;

    move-result-object v20

    invoke-virtual/range {v20 .. v20}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v5

    .line 591
    .local v5, countryCodeNetwork:Ljava/lang/String;
    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v20

    invoke-virtual/range {v20 .. v20}, Ljava/util/Locale;->toString()Ljava/lang/String;

    move-result-object v13

    .line 593
    .local v13, locale:Ljava/lang/String;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v20

    sget-object v21, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    move-object/from16 v0, v20

    move-object/from16 v1, v21

    if-ne v0, v1, :cond_4

    .line 595
    const-string v20, "AdView SDK v1.7.0"

    new-instance v21, Ljava/lang/StringBuilder;

    const-string v22, "run in device, imei="

    invoke-direct/range {v21 .. v22}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, v21

    move-object v1, v8

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v21

    invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 596
    const-string v20, "AdView SDK v1.7.0"

    new-instance v21, Ljava/lang/StringBuilder;

    const-string v22, "countryCodeDefault="

    invoke-direct/range {v21 .. v22}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, v21

    move-object v1, v4

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v21

    invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 597
    const-string v20, "AdView SDK v1.7.0"

    new-instance v21, Ljava/lang/StringBuilder;

    const-string v22, "countryCodeNetwork="

    invoke-direct/range {v21 .. v22}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, v21

    move-object v1, v5

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v21

    invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 598
    const-string v20, "AdView SDK v1.7.0"

    new-instance v21, Ljava/lang/StringBuilder;

    const-string v22, "locale="

    invoke-direct/range {v21 .. v22}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, v21

    move-object v1, v13

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v21

    invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 601
    :cond_4
    if-eqz v5, :cond_6

    invoke-virtual {v5}, Ljava/lang/String;->length()I

    move-result v20

    if-lez v20, :cond_6

    .line 603
    const-string v20, "cn"

    move-object v0, v5

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Ljava/lang/String;->compareTo(Ljava/lang/String;)I

    move-result v20

    if-nez v20, :cond_5

    .line 604
    const/16 v20, 0x0

    goto/16 :goto_0

    .line 606
    :cond_5
    const/16 v20, 0x1

    goto/16 :goto_0

    .line 609
    :cond_6
    if-eqz v4, :cond_8

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v20

    if-lez v20, :cond_8

    .line 611
    const-string v20, "cn"

    move-object v0, v4

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Ljava/lang/String;->compareTo(Ljava/lang/String;)I

    move-result v20

    if-nez v20, :cond_7

    .line 612
    const/16 v20, 0x0

    goto/16 :goto_0

    .line 614
    :cond_7
    const/16 v20, 0x1

    goto/16 :goto_0

    .line 619
    :cond_8
    :try_start_0
    const-string v18, "location"

    .line 620
    .local v18, serviceName:Ljava/lang/String;
    move-object v0, v3

    move-object/from16 v1, v18

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v15

    check-cast v15, Landroid/location/LocationManager;

    .line 621
    .local v15, locationManager:Landroid/location/LocationManager;
    new-instance v6, Landroid/location/Criteria;

    invoke-direct {v6}, Landroid/location/Criteria;-><init>()V

    .line 622
    .local v6, criteria:Landroid/location/Criteria;
    const/16 v20, 0x1

    move-object v0, v6

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/location/Criteria;->setAccuracy(I)V

    .line 623
    const/16 v20, 0x0

    move-object v0, v6

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/location/Criteria;->setAltitudeRequired(Z)V

    .line 624
    const/16 v20, 0x0

    move-object v0, v6

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/location/Criteria;->setBearingRequired(Z)V

    .line 625
    const/16 v20, 0x1

    move-object v0, v6

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/location/Criteria;->setCostAllowed(Z)V

    .line 626
    const/16 v20, 0x1

    move-object v0, v6

    move/from16 v1, v20

    invoke-virtual {v0, v1}, Landroid/location/Criteria;->setPowerRequirement(I)V

    .line 628
    const/16 v20, 0x1

    move-object v0, v15

    move-object v1, v6

    move/from16 v2, v20

    invoke-virtual {v0, v1, v2}, Landroid/location/LocationManager;->getBestProvider(Landroid/location/Criteria;Z)Ljava/lang/String;

    move-result-object v17

    .line 629
    .local v17, provider:Ljava/lang/String;
    const/4 v14, 0x0

    .line 631
    .local v14, location:Landroid/location/Location;
    if-eqz v17, :cond_9

    invoke-virtual/range {v17 .. v17}, Ljava/lang/String;->length()I

    move-result v20

    if-lez v20, :cond_9

    .line 633
    const-string v20, "AdView SDK v1.7.0"

    new-instance v21, Ljava/lang/StringBuilder;

    const-string v22, "provider="

    invoke-direct/range {v21 .. v22}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, v21

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v21

    invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 634
    const-string v20, "AdView SDK v1.7.0"

    new-instance v21, Ljava/lang/StringBuilder;

    invoke-static/range {v17 .. v17}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v22

    invoke-direct/range {v21 .. v22}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v22, " enable ="

    invoke-virtual/range {v21 .. v22}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v21

    move-object v0, v15

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v22

    invoke-virtual/range {v21 .. v22}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v21

    invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 635
    move-object v0, v15

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->getLastKnownLocation(Ljava/lang/String;)Landroid/location/Location;

    move-result-object v14

    .line 638
    :cond_9
    if-eqz v14, :cond_a

    .line 639
    const-string v20, "AdView SDK v1.7.0"

    const-string v21, "location != null"

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 641
    invoke-virtual {v14}, Landroid/location/Location;->getLatitude()D

    move-result-wide v9

    .line 642
    .local v9, lat:D
    invoke-virtual {v14}, Landroid/location/Location;->getLongitude()D

    move-result-wide v11

    .line 643
    .local v11, lng:D
    new-instance v20, Ljava/lang/StringBuilder;

    invoke-static {v9, v10}, Ljava/lang/String;->valueOf(D)Ljava/lang/String;

    move-result-object v21

    invoke-direct/range {v20 .. v21}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v21, ","

    invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v20

    move-object/from16 v0, v20

    move-wide v1, v11

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v20

    invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v16

    .line 644
    .local v16, locationString:Ljava/lang/String;
    const-string v20, "AdView SDK v1.7.0"

    new-instance v21, Ljava/lang/StringBuilder;

    const-string v22, "locationString="

    invoke-direct/range {v21 .. v22}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, v21

    move-object/from16 v1, v16

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v21

    invoke-virtual/range {v21 .. v21}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 654
    .end local v6           #criteria:Landroid/location/Criteria;
    .end local v9           #lat:D
    .end local v11           #lng:D
    .end local v14           #location:Landroid/location/Location;
    .end local v15           #locationManager:Landroid/location/LocationManager;
    .end local v16           #locationString:Ljava/lang/String;
    .end local v17           #provider:Ljava/lang/String;
    .end local v18           #serviceName:Ljava/lang/String;
    :goto_1
    const/16 v20, 0x0

    goto/16 :goto_0

    .line 648
    .restart local v6       #criteria:Landroid/location/Criteria;
    .restart local v14       #location:Landroid/location/Location;
    .restart local v15       #locationManager:Landroid/location/LocationManager;
    .restart local v17       #provider:Ljava/lang/String;
    .restart local v18       #serviceName:Ljava/lang/String;
    :cond_a
    const-string v20, "AdView SDK v1.7.0"

    const-string v21, "location == null"

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    .line 650
    .end local v6           #criteria:Landroid/location/Criteria;
    .end local v14           #location:Landroid/location/Location;
    .end local v15           #locationManager:Landroid/location/LocationManager;
    .end local v17           #provider:Ljava/lang/String;
    .end local v18           #serviceName:Ljava/lang/String;
    :catch_0
    move-exception v20

    move-object/from16 v7, v20

    .line 651
    .local v7, e:Ljava/lang/Exception;
    const-string v20, "AdView SDK v1.7.0"

    invoke-virtual {v7}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v21

    invoke-static/range {v20 .. v21}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1
.end method

.method public resetRollover()V
    .locals 1

    .prologue
    .line 178
    iget-object v0, p0, Lcom/adview/AdViewManager;->rationsList:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    iput-object v0, p0, Lcom/adview/AdViewManager;->rollovers:Ljava/util/Iterator;

    .line 179
    return-void
.end method

.method public resetRollover_pri()V
    .locals 0

    .prologue
    .line 176
    return-void
.end method

.method public setYoumiInit(Z)V
    .locals 0
    .parameter "flag"

    .prologue
    .line 87
    iput-boolean p1, p0, Lcom/adview/AdViewManager;->youmiInit:Z

    .line 88
    return-void
.end method
